using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.Common;
using Husb.Data;
using Husb.DataUtil;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Caching;

using CentralOffice.MyTable.Data;

using ViewSmsTable = CentralOffice.MyTable.Data.SmsDataSet.View_SmsDataTable;
using ViewSmsRow = CentralOffice.MyTable.Data.SmsDataSet.View_SmsRow;
namespace CentralOffice.MyTable.DataAccess
{
    public class ViewSmsAdapter : DataAccessAdapter<MyTable.Data.SmsDataSet, ViewSmsTable, ViewSmsRow>
    {
        public ViewSmsAdapter()
        {
            this.TableName = "View_Sms";
            DeleteStoredProc = "ViewSms_DeleteViewSms";

            GetAllStoredProc = "ViewSms_SelectViewSmsAll";
            InsertStoredProc = "ViewSms_InsertViewSms";
            UpdateStoredProc = "ViewSms_UpdateViewSms";
            FindStoredProc = "ViewSms_SelectViewSmsDynamic";
            GetByIdStoredProc = "ViewSms_SelectViewSms";
            GetPagedStoredProc = "ViewSms_SelectViewSmsPaged";
            GetRowCountStoredProc = "ViewSms_SelectViewSmsRowCount";
        }

        protected override void PopulateInsertParameters(Database db, DbCommand cmd)
        {
            db.AddInParameter(cmd, "SmsId", DbType.Int32, "SmsId", DataRowVersion.Current);
            db.AddInParameter(cmd, "ToId", DbType.AnsiString, "ToId", DataRowVersion.Current);
            db.AddInParameter(cmd, "RemindFlag", DbType.AnsiStringFixedLength, "RemindFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "DeleteFlag", DbType.AnsiStringFixedLength, "DeleteFlag", DataRowVersion.Current);
            db.AddInParameter(cmd, "BodyId", DbType.Int32, "BodyId", DataRowVersion.Current);
            db.AddInParameter(cmd, "FromId", DbType.AnsiString, "FromId", DataRowVersion.Current);
            db.AddInParameter(cmd, "SmsType", DbType.AnsiString, "SmsType", DataRowVersion.Current);
            db.AddInParameter(cmd, "Content", DbType.AnsiString, "Content", DataRowVersion.Current);
            db.AddInParameter(cmd, "SendTime", DbType.DateTime, "SendTime", DataRowVersion.Current);
            db.AddInParameter(cmd, "RemindUrl", DbType.AnsiString, "RemindUrl", DataRowVersion.Current);
            db.AddInParameter(cmd, "sGuid", DbType.AnsiString, "sGuid", DataRowVersion.Current);
        }
    }
}
